package com.shop.common.enums.user;

import lombok.Getter;

/**
 * 流水表 对应table name
 */
@Getter
public enum BillTableNameEnum {

    PINK("store_pink", "参与拼团"),
    ORDER("store_order", "购买商品"),
    JISHOUTOBILL("pink_jishou", "寄售转余额流水"),
    EXTRACT("extract", "用户提现"),
    CANCAL_STORE_PINK("cancal_store_pink", "取消拼团"),
    EXPEND("1", "支出"),
    TEAM_BACK("team_back", "团队返佣"),
    AUTOPINK("auto_pink", "自动续拼"),
    RECHARGE("recharge", "购买充值商品"),
    INTEGRAL_ORDER("integral_order", "积分商品订单下单"),
    CANCEL_INTEGRAL_ORDER("cancel_integral_order", "积分商品订单取消"),
    GET_GOODS_SEND_INTEGRAL("get_goods_send_integral", "提货商品获得积分"),
    INTEGRAL_PAY_ORDER("integral_pay_order", "积分下单获得积分"),
    INTEGRAL_FIRST_PINK_ORDER("integral_first_pink_order", "新用户首单获得积分"),
    INTEGRAL_FIRST_PINK_SPREAD_ORDER("integral_first_pink_spread_order", "新用户首单推荐人获得积分"),
    INTEGRAL_POS_BILL("integral_pos_bill", "新用户首单推荐人获得积分"),
    AUTH_SUCCESS_SEND_SPREAD_INGEGRAL("auth_success_send_spread_ingegral", "实名认证成功推荐人赠送积分"),
    USER_SIGN_IN("user_sign_in", "用户签到获得积分"),
    WATCH_VIDEOS_INTEGRAL("watch_videos_integral", "用户签到获得积分"),
    SNAP_PINK_SUCCESS("snap_pink_success", "抢购拼团第五单获得佣金"),
    ;

    private String key;
    private String name;

    BillTableNameEnum(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public static BillTableNameEnum val(int key) {
        for (BillTableNameEnum enumObj : BillTableNameEnum.values()) {
            if(enumObj.key.equals(key)) {
                return enumObj;
            }
        }
        return null;
    }
}
